
import { _decorator, Sprite } from 'cc';
import { SCENE_ENUM, Trigger_Status_Enum, Trigger_Type_Enum } from '../Enum';
import DataManager from '../Runtime/DataManager';
import { TriggerManager } from './TriggerManager';
const { ccclass, property } = _decorator;


@ccclass('DoorTriggerManager')
export class DoorTriggerManager extends TriggerManager {
    type: Trigger_Type_Enum = Trigger_Type_Enum.Door;

    status: Trigger_Status_Enum = Trigger_Status_Enum.Pendding;

    render() {
        super.render();
        this.node.getComponent(Sprite).enabled = DataManager.Instance.doorStatus === Trigger_Status_Enum.Pendding;
    }

    handerClick(event) {
        if (DataManager.Instance.doorStatus === Trigger_Status_Enum.Pendding) {
            DataManager.Instance.curScene = (SCENE_ENUM.H2A);
        } else {
            DataManager.Instance.curScene = (SCENE_ENUM.H3);
        }
    }
}
